<template>
  <div class="callCenterInfos">
    <TitleName
      class="title mb-20px"
      icon="i-carbon-bookmark-filled"
      title="设备明细"
    ></TitleName>
    <el-table :data="tableList" border>
      <el-table-column label="物品编码" prop="articleNo" width="180" />
      <el-table-column label="物品名称" prop="articleName"> </el-table-column>
      <!--      <el-table-column-->
      <!--        :show-overflow-tooltip="true"-->
      <!--        label="物品条码"-->
      <!--        prop="articleNo"-->
      <!--      />-->
      <el-table-column
        :show-overflow-tooltip="true"
        label="开票机号"
        prop="billingMachineNo"
        width="110"
      />
      <el-table-column label="出库日期" prop="businessDate" width="180" />
      <el-table-column label="到期时间" prop="serviceValidDate" width="180" />
      <el-table-column label="状态" prop="statusName" width="110" />
    </el-table>
    <pagination
      v-show="total > 0"
      v-model:limit="searchFrom.pageSize"
      v-model:page="searchFrom.pageNum"
      :total="total"
      @pagination="getList"
    />
  </div>
</template>

<script name="PRSdevicelist" setup>
import { getCurrentInstance } from 'vue'
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
const { proxy } = getCurrentInstance()
import useUserStore from '@/store/modules/user'
import useCommonStore from '@/store/modules/common'
import { selectDictLabel } from '@/utils/ruoyi'
import { getOrderList } from '@/api/salesManage/contractManage'
import { equipmentList } from '@/api/callCenter'
const userStore = useUserStore()
const commonStore = useCommonStore()
const { order_business_type, order_invoice_status, order_status } =
  proxy.useDict('order_invoice_status', 'order_business_type', 'order_status')
// 接受父级传递的参数
const props = defineProps({
  paramData: {
    required: true,
    type: Object || Array,
    default: () => {
      return {}
    }
  }
})

const data = reactive({
  searchFrom: {
    pageSize: 10,
    pageNum: 1
  },
  total: 0,
  tableList: []
})
const { searchFrom, total, tableList } = toRefs(data)
function getList() {
  equipmentList({
    customerTaxcode: props.paramData.customerTaxcode,
    customerId: props.paramData.customerId,
    pageSize: searchFrom.value.pageSize,
    pageNum: searchFrom.value.pageNum
  }).then(res => {
    total.value = res.total
    tableList.value = res.rows
  })
}
watch(
  () => props.paramData,
  val => {
    if (JSON.stringify(val) != '{}') {
      console.log('设备接收参数：', val)
      getList()
    }
  },
  {
    immediate: true,
    deep: true
  }
)
</script>

<style lang="scss" scoped></style>
